home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
rjs.lha
/
RJS
/
Transport
/
tests
/
rchargen.C
< prev
next >
Wrap
C/C++ Source or Header
|
1991-06-14
|
543b
|
27 lines
#include <iostream.h>
#include "RJS/Transport.h"
#include <osfcn.h>
#include <libc.h>
int main(int argc, char *argv[])
{
if (argc!=2) {
cerr << "usage: " << argv[0] << " host" << endl;
exit(1);
}
InetAddress daytime_address(argv[1],"chargen","udp");
InetDatagram daytime_server;
daytime_server.socket_client();
daytime_server.send("time please",12); // send to server
char buffer[512];
int nbr=daytime_server.recv(buffer,512); // get reply
buffer[nbr]=0;
cout << "rdaytime => " << buffer << endl;
exit(0);
}